package com.guigu.liuyunan.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.liuyunan.pojo.Checkitem;
import com.guigu.liuyunan.pojo.LYNPageVo;
import com.guigu.liuyunan.service.CheckitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("LYN")
public class CheckitemController {

    @Autowired
    CheckitemService cs;


    @PostMapping("checkItemInfo")
    public PageInfo<Checkitem> checkitemInfo(@RequestBody LYNPageVo pageVo){
        if (pageVo.getName()!=null){
            pageVo.setName(pageVo.getName().trim());
        }
        return cs.checkitemInfo(pageVo);
    }

    @PostMapping("addCheckItem")
    public int addCheckItem(@RequestBody Checkitem checkitem){
        return cs.addCheckItem(checkitem);
    }

    @GetMapping("delCheckItem")
    public int delCheckItem(Integer id){
        return cs.delCheckItem(id);
    }

    @PostMapping("UpCheckItem")
    public int UpCheckItem(@RequestBody Checkitem checkitem){
        return cs.UpCheckItem(checkitem);
    }
}
